import dayjs from "dayjs";
import { XTableColumn } from "./demos/types";

export const customerSelectColumns = [
    {
        prop: "CustomerCode",
        label: "客户编码",
        width: 150,
    }, {
        prop: "CustomerName",
        label: "客户名称",
        width: 200,
    },
]
export const paytermSelectColumns = [
    {
        prop: "PayTermName",
        label: "付款期",
        width: 150,
    }, {
        prop: "PayTermDays",
        label: "天数",
        width: 70,
    },
]

export const orderDetailColumns: XTableColumn[] = [
    {
        prop: "GoodsNum",
        width: 200,
        label: '客方货号',
        editor: 'dataGridComboBoxEditor',
    },
    {
        prop: "BoxNum",
        width: 150,
        label: '盒式',
    },{
        prop: "PapperCode",
        width: 150,
        label: '纸质',
    },
]

export const customerGoodsSeletColumns: XTableColumn[] = [
    {
        prop: "Number",
        width: 100,
        label: '客方货号',
    },
    {
        prop: "BoxInfoName",
        width: 100,
        label: '盒式',
    },{
        prop: "PapperCode",
        width: 100,
        label: '纸质',
    },{
        prop: "Specifics",
        width: 200,
        label: '规格',
        formatter: (val, row)=>{
            return `${row.X}x${row.Y}x${row.Z} `+ (row.UnitName?row.UnitName:'')
        }
    },
]

export const orderTableColumns: XTableColumn[] = [
    {
        prop: "OrderId",
        width: 50,
        label: 'ID',
    },
    {
        prop: "OrderSN",
        width: 200,
        label: 'Order SN',
        editor: 'textEditor'
    },
    {
        prop: "CustomerCode",
        width: 150,
        label: '客户编码',
        editor: 'dataGridComboBoxEditor',
    }, {
        prop: "CustomerName",
        width: 200,
        label: '客户名称',
    },
    {
        prop: "CustomerPO",
        width: 150,
        label: '客户PO',
        editor: 'textEditor'
    }, {
        prop: "CreateTime",
        width: 200,
        label: '下单时间',
        editor: 'dateEditor',
        formatter: function (d: string) {
            return dayjs(d).format('YYYY-MM-DD')
        }
    },
];